//
// Created by jsjxsy on 2022/6/23.
//
#include <stdio.h>
#include <errno.h>
#include <string.h>

int main() {
    char c;
    printf("please input char:\n");
    c = getc(stdin);
    printf("input of char:\n");
    putc(c, stdout);

    char *str;
    scanf("%s", str);
    printf("%s", str);

    FILE *f;
    f = fopen("CMakeLists.txt", "r");
    if (f) {
        while (1) {
            int next_char = getc(f);
            printf("feof: %d", feof(f));
            if (feof(f)) {
                break;
            } else {
                putchar(next_char);

            }

        }
        fclose(f);
    } else {
        printf("%s", strerror(errno));
        perror("error information:");
    }


    return 0;
}



